
package com.insigma.business.qrcode.welfare.service.impl;


import com.insigma.business.qrcode.common.service.SequenceGenerator;
import com.insigma.business.qrcode.soldier.dto.SequenceNameConstant;
import com.insigma.business.qrcode.welfare.dao.MarketingSpotMaterialsDao;
import com.insigma.business.qrcode.welfare.dto.MarketingSpotBSearcher;
import com.insigma.business.qrcode.welfare.dto.MarketingSpotMaterialsBSearcher;
import com.insigma.business.qrcode.welfare.entity.MarketingSpotMaterialsDO;
import com.insigma.business.qrcode.welfare.service.MarketingSpotMaterialsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("marketingSpotMaterialsService")
public class MarketingSpotMaterialsServiceImpl implements MarketingSpotMaterialsService {

    @Autowired(required = false)
    private MarketingSpotMaterialsDao marketingSpotMaterialsDao;
    @Autowired(required = false)
    private SequenceGenerator sequenceGenerator;

    
    @Override
    public List<MarketingSpotMaterialsDO> search(final MarketingSpotMaterialsBSearcher marketingSpotMaterialsBSearcher) {
        return marketingSpotMaterialsDao.search(marketingSpotMaterialsBSearcher);
    }
   
    @Override
    public MarketingSpotMaterialsDO get(final String id){
        return marketingSpotMaterialsDao.get(id);
    }

    
    @Override
    public Integer insert(final MarketingSpotMaterialsDO marketingSpotMaterialsDO){
        marketingSpotMaterialsDO.setId(sequenceGenerator.genKey(SequenceNameConstant.MARKETING_SPOT_MATERIALS_ID));
        return marketingSpotMaterialsDao.insert(marketingSpotMaterialsDO);
    }

    
    @Override
    public Integer update(final MarketingSpotMaterialsDO marketingSpotMaterialsDO){
        return marketingSpotMaterialsDao.update(marketingSpotMaterialsDO);
    }

    
    @Override
    public Integer delete(final String id, final String modifierType, final String modifierId){
        return marketingSpotMaterialsDao.delete(id,modifierType,modifierId);
    }

    @Override
    public List<MarketingSpotMaterialsDO> listBySearcher(MarketingSpotBSearcher marketingSpotBSearcher) {
        return marketingSpotMaterialsDao.listBySearcher(marketingSpotBSearcher);
    }

    @Override
    public MarketingSpotMaterialsDO getMaterialByName(String name) {
        return marketingSpotMaterialsDao.getMaterialByName(name);
    }

}
